package com.yjd.job.dao.impl;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Component;

import com.yjd.comm.base.dao.impl.BaseDaoImpl;
import com.yjd.job.dao.IJobLogDao;
import com.yjd.job.model.JobLogModel;

/**
 * <b>description</b>：job执行日志数据访问对象 <br>
 * <b>time</b>：2014-11-10下午1:45:29 <br>
 * <b>author</b>： ready likun_557@163.com
 */
@Component("jobLogDao")
public class JobLogDaoImpl extends BaseDaoImpl implements IJobLogDao {
	private static final String SQLMAPNAMESPACE = JobLogModel.class.getName();
	private static final String PKNAME = "idJobLog";

	@Override
	public String getPrimaryKeyName() {
		return PKNAME;
	}

	@Override
	public String getSqlmapNamespace() {
		return SQLMAPNAMESPACE;
	}

	@Override
	public long getFailedJobListCount(Map<Object, Object> paramMap, boolean write) throws Exception
	{
		return (long) this.getSqlMap(write).queryForObject(getNamesapceToSqlmapPrefix() + "getFailedJobListCount", paramMap);
	}

	@SuppressWarnings("rawtypes")
	@Override
	public List getFailedJobList(Map<Object, Object> paramMap, boolean write) throws Exception
	{
		return this.getSqlMap(write).queryForList(getNamesapceToSqlmapPrefix() + "getFailedJobList", paramMap);
	}
}
